 #!/bin/bash
echo "Which subdirectory would you like to convert the videos in? EX: 'Cabaret', 'Student_Life', 'Photograyh'";
read dir;
dir="/var/www/DiMF/media/video/"${dir};
echo "Are you sure you want to convert the videos in ${dir}?(y/n)";
read answer;
if [[ $answer =~ "y" ]]
then
	echo "Converting started.";
		for file in ${dir}/*
		do
		ffmpeg -i ${file} -ar 44100 -vcodec flv ${file}.flv
		mv ${file} /var/www/DiMF/media/archive/
		echo "--${file}"
		done
	echo "Converting done.";
else 
	echo "Aborting...";
fi